from apscheduler.jobstores import redis

from commonModelData.CommonModelData import AModelData
from commonModelData.impl.ModelData2N0 import ModelData2N0
from commonModelData.impl.ModelData2N1 import ModelData2N1
from pojo.TtsLogin import TTS_Login
from utils import MumberUtils
from utils.RedisUtils import RedisUtil

"""
 单双切换
"""
class ModelData2N(AModelData):
    def getModelData(self):
        # trendStr = ""
        # for eachTrend in self.BLogin.doneData[0:6]:
        #     trendStr += "0" if MumberUtils.strToInt(eachTrend["LuckNum"]) % 2 == 0 else "1"
        #
        # redis = RedisUtil()
        # res = redis.getHistoryLotteryInfo()
        # for i in res:
        #     if trendStr in i:
        #         print(f"命中了跳跃走势{i},跳过当期下注,当前号码走势{trendStr}")
        #         return self.BLogin


        if MumberUtils.strToInt(self.BLogin.luckNum) % 2 ==0 :
            model = ModelData2N0()

        elif MumberUtils.strToInt(self.BLogin.luckNum )% 2 ==1 :
            model = ModelData2N1()
        model.setBlogin(self.BLogin)



if __name__ == '__main__':
    login = TTS_Login()
    model = ModelData2N0()
    model.setBlogin(login)
    print(login.modelData)

    model = ModelData2N1()
    model.setBlogin(login)
    print(login.modelData)
    print("sss  ")